/*
 * =====================================================================================
 *
 *       Filename:  kernel.cpp
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  10/12/2010 07:25:33 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Chen Ken (Ken), zlchen.ken@gmail.com
 *        Company:  EMC
 *
 * =====================================================================================
 */

#define BOOST_TEST_MODULE kernel_ut 
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include <string>
#include <iostream>
#include "cl_ring_buffer.hxx"
#include "cl_id.hxx"

using namespace std;
using namespace neo;

BOOST_AUTO_TEST_SUITE(kernel_ut)

BOOST_AUTO_TEST_CASE(id_test)
{
	CLId id1 = CLId::allocate();
	CLId id2 = CLId::allocate();
  cout << id1 << "\n" << id2 << "\n";
}

BOOST_AUTO_TEST_CASE(ring_buffer)
{
  CLRingBuffer<int> intRing(10);
  for(int i = 0; i < 100; ++i)
  {
    intRing.push(i);
    BOOST_CHECK(intRing.back() == i);
  }
}

BOOST_AUTO_TEST_SUITE_END()

